import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import settings from './modules/settings'
import user from './modules/user'
import attendance from './modules/attendance'
import company from './modules/company'
import organization from './modules/organization'
import file from './modules/file'
import register from './modules/register'
import approval from './modules/approval'
import VuexPersist from 'vuex-persist'

Vue.use(Vuex)

const vuexLocal = new VuexPersist({
  storage:window.sessionStorage
});

const store = new Vuex.Store({
  plugins:[vuexLocal.plugin],
  modules: {
    app,
    settings,
    user,
    attendance,
    company,
    organization,
    file,
    register,
    approval
  },
  getters
})

export default store
